#include<iostream>
using namespace std;
int n;
int main()
{
	cin >> n;
	bool flag = 0;
	for (int i = 1; i <= n; i++) {
		int ans = (1 + i) * i / 2;
		if (ans == n) {
			cout << "YES" << endl;
			return 0;
		}
	}
	cout << "NO" << endl;
	return 0;
}